/**
 * Created by lanouhn on 17/7/20.
 */
var app = require("express")();
var mysql = require("mysql");
var link = mysql.createConnection({
    host:"localhost",
    user:"root",
    password:"",
    database:"Friday"
});
//连接数据库
link.connect();
// app.get("/",function (req,res) {
//     res.sendfile("classify.html")
// })
app.get("/classify",function (req,res) {
    link.query("SELECT * FROM information",function (err,rows,fields) {
        if(err){
            console.log(err)
        }else {
            for(var i=0;i<rows.length;i++){
                
            }
        }

    })
})


app.get("*",function (req,res) {
    // console.log(__dirname);
    res.sendFile(__dirname+req.path)
})
app.listen(8080)